﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;


namespace RxTestbed
{
    class Testing
    {
        static void Main(string[] args)
        {
            List<int> l = new List<int> { 1, 2, 3, 4, 5 };
            IEnumerable<int> e = l;

            IObservable<int> source = e.ToObservable();
            /*IDisposable subscription =*/ source.Subscribe(
                            x => Console.WriteLine("OnNext: {0}", x),
                            ex => Console.WriteLine("OnError: {0}", ex.Message),
                            () => Console.WriteLine("OnCompleted"));

            //doesn't show.
            l.Add(8);

            

            Console.ReadKey();
        }
    }
}
